package zen2d.example.plane;

import zen2d.GraphicsContext;
import zen2d.Sprite;
import zen2d.SwingWindow;
import zen2d.Zen2d;
import zen2d.util.AssertUtil;

import java.awt.image.BufferedImage;

public class Wave extends Sprite {
    private BufferedImage normal;

    public Wave(int x, int y, int width, int height) {
        super(x, y, width, height);
        normal = AssertUtil.getImage("image/plane/wave.png");
    }

    @Override
    protected void afterEndLive() {
        Zen2d.addSprite(new Explode(x,y,100,100));
    }

    @Override
    protected void update() {
        y -= 3;
        if (y <= 0){
            super.endLive();
        }
    }

    @Override
    protected void draw(GraphicsContext graphicsContext) {
        graphicsContext.drawImage(normal,x,y,width,height);
    }

    @Override
    protected void up() {

    }

    @Override
    protected void down() {

    }

    @Override
    protected void left() {

    }

    @Override
    protected void right() {

    }

    @Override
    protected void space() {

    }
}
